package agents.tourguideagentbehaviours;

import java.io.IOException;
import agents.TourGuideAgent;
import jade.core.behaviours.OneShotBehaviour;
import jade.lang.acl.ACLMessage;

public class SendTourToUserBehaviour extends OneShotBehaviour{
	TourGuideAgent owner;
	
	public SendTourToUserBehaviour(TourGuideAgent owner){
		this.owner = owner;
	}
	@Override
	public void action() {
		ACLMessage message = new ACLMessage(ACLMessage.INFORM);
		message.addReceiver(owner.getUserAID());
		try {
			message.setContentObject(owner.getTour());
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		owner.send(message);
	}
}
